#include <iostream>
using namespace std;
class Animal
{
public:
    virtual void runing() = 0;
    virtual void Sing() = 0;
};

class People : public Animal
{
public:
    // 1、以 final 修饰的虚函数，禁止“再往下一层”的派生类去**覆盖（override）**它
    void Sing() final
    {
        cout << "People's Sing is runing" << endl;
    }
};
class Student : public People
{
public:
    int classNo;
    Student(int classNo) : classNo{classNo}
    {
    }
    void runing() override
    {
        cout << "Student is runing" << endl;
    }
    // override修饰符：只能出现在虚函数的重新声明上
    // 1、基类People没有Sing函数，报错
    // 2、基类People中Sing虚函数不能为final
    // void Sing() override
    // {
    //     cout << "Student is sing song" << endl;
    // }
};
int main()
{
    Student s1(18);
    s1.runing();
    s1.Sing();
    return 0;
}
